import request from '@/utils/request'

// 查看机柜
export function listCabin(query) {
  return request({
    url: '/admin/roomcabin/cabin/',
    method: 'get',
    params: query
  })
}

// 添加机柜
export function addCabin(data) {
  return request({
    url: '/admin/roomcabin/cabin/',
    method: 'post',
    data: data
  })
}

// 修改机柜
export function updateCabin(data) {
    return request({
        url: `/admin/roomcabin/cabin/${data.id}/`,
        method: 'put',
        data: data
      })
}


// 删除机柜
export function delCabin(query) {
  return request({
    url: `/admin/roomcabin/cabin/${query}/`,
    method: 'delete',
  })
}

// 查看机房
export function listRoom(query) {
  return request({
    url: '/admin/roomcabin/room/',
    method: 'get',
    params: query
  })
}

// 添加机房
export function addRoom(data) {
  return request({
    url: '/admin/roomcabin/room/',
    method: 'post',
    data: data
  })
}

// 修改机房
export function updateRoom(data) {
    return request({
        url: `/admin/roomcabin/room/${data.id}/`,
        method: 'put',
        data: data
      })
}


// 删除机房
export function delRoom(query) {
  return request({
    url: `/admin/roomcabin/room/${query}/`,
    method: 'delete',
  })
}